package com.starblink.brand.adapter

import com.starblink.android.basic.adapter.BaseBindingVH
import com.starblink.basic.style.R
import com.starblink.basic.util.CommUtils
import com.starblink.brand.bean.FilterCategoryTitleBean
import com.starblink.brand.databinding.CellFilterLetterBinding
import com.starblink.brand.ui.FilterCategoryI

/**
 * A B C D E ...
 */
class FilterTextCell (binding: CellFilterLetterBinding, var filterDialogI: FilterCategoryI?=null) :
    BaseBindingVH<FilterCategoryTitleBean, CellFilterLetterBinding>(binding) {
    override fun onBind(model: FilterCategoryTitleBean, position: Int) {
        binding.tvFilterTitle.text=model.key.toString()
        if(model.ifChecked){
            binding.tvFilterTitle.setTextColor(CommUtils.getColor(R.color.sk_gray400))
        }else{
            binding.tvFilterTitle.setTextColor(CommUtils.getColor(R.color.sk_gray400_opacity30))
        }
        binding.tvFilterTitle.setOnClickListener {
            filterDialogI?.scrollToLetter(model.key)
        }
    }
}